package com.spsy.orders.service.impl;

import java.util.List;
import com.spsy.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.spsy.orders.listener.mapper.OrdersMapper;
import com.spsy.orders.domain.Orders;
import com.spsy.orders.service.IOrdersService;

/**
 * 订单sService业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-09
 */
@Service
public class OrdersServiceImpl implements IOrdersService 
{
    @Autowired
    private OrdersMapper ordersMapper;

    /**
     * 查询订单s
     * 
     * @param orderId 订单s主键
     * @return 订单s
     */
    @Override
    public Orders selectOrdersByOrderId(Long orderId)
    {
        return ordersMapper.selectOrdersByOrderId(orderId);
    }

    /**
     * 查询订单s列表
     * 
     * @param orders 订单s
     * @return 订单s
     */
    @Override
    public List<Orders> selectOrdersList(Orders orders)
    {
        return ordersMapper.selectOrdersList(orders);
    }


    /**
     * 查询订单s列表
     *
     * @return 订单s
     */
    @Override
    public List<Orders> selectOrdersTotalAmountTopTen()
    {
        return ordersMapper.selectOrdersTotalAmountTopTen();
    }





    /**
     * 新增订单s
     * 
     * @param orders 订单s
     * @return 结果
     */
    @Override
    public int insertOrders(Orders orders)
    {
        orders.setCreateTime(DateUtils.getNowDate());
        return ordersMapper.insertOrders(orders);
    }

    /**
     * 修改订单s
     * 
     * @param orders 订单s
     * @return 结果
     */
    @Override
    public int updateOrders(Orders orders)
    {
        orders.setUpdateTime(DateUtils.getNowDate());
        return ordersMapper.updateOrders(orders);
    }

    /**
     * 批量删除订单s
     * 
     * @param orderIds 需要删除的订单s主键
     * @return 结果
     */
    @Override
    public int deleteOrdersByOrderIds(Long[] orderIds)
    {
        return ordersMapper.deleteOrdersByOrderIds(orderIds);
    }

    /**
     * 删除订单s信息
     * 
     * @param orderId 订单s主键
     * @return 结果
     */
    @Override
    public int deleteOrdersByOrderId(Long orderId)
    {
        return ordersMapper.deleteOrdersByOrderId(orderId);
    }
}
